//
//  ViewController.m
//  16-多线程网络总结
//
//  Created by J on 16/2/26.
//  Copyright © 2016年 J. All rights reserved.
//

#import "ViewController.h"
#import "AFNetworking.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    AFHTTPSessionManager* manager = [AFHTTPSessionManager manager];
    [manager POST:@"" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData>  _Nonnull formData) {
    
        //name参数名
        [formData appendPartWithFileURL:[NSURL fileURLWithPath:@""] name:@"" error:nil];//mimeType内部自动获取
        
//        [formData appendPartWithFileURL:[NSURL fileURLWithPath:@""] name:@"" fileName:@"" mimeType:@"image/png" error:nil];
        
        
        //这个block专门放文件参数
        //        NSData* data = [NSData dataWithContentsOfFile:@""];
//        [formData appendPartWithFileData:data name:@"file" fileName:@"" mimeType:@"mimeType"];
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nonnull responseObject) {
        
        
    } failure:^(NSURLSessionDataTask * _Nonnull task, NSError * _Nonnull error) {
        
        
    }];

    
    
    
    
   AFHTTPRequestOperationManager* ma =  [AFHTTPRequestOperationManager manager];
    [ma GET:@"" parameters:@"" success:^(AFHTTPRequestOperation * _Nonnull operation, id  _Nonnull responseObject) {
        
        
    } failure:^(AFHTTPRequestOperation * _Nonnull operation, NSError * _Nonnull error) {
        
        
    }];
 
    
}



@end
